package net.ocps.tchs.scarymazegame;

import net.ocps.tchs.scarymazegame.scarymazegame;
import  net.ocps.tchs.scarymazegame.tween.SpriteAccessor;
import aurelienribon.tweenengine.BaseTween;
import aurelienribon.tweenengine.Tween;
import aurelienribon.tweenengine.TweenCallback;
import aurelienribon.tweenengine.TweenManager;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;

public class Menu extends Game implements Screen {

	private BitmapFont font;
	private SpriteBatch batch;
	ShapeRenderer shape;

	@Override
	public void render(float delta) {

System.out.println(scarymazegame.camera.viewportWidth + ", " + scarymazegame.camera.viewportHeight);
		shape.begin(ShapeType.FilledRectangle);
		shape.setColor(Color.BLACK);
		shape.filledRect(0,0,(scarymazegame.camera.viewportWidth)*scarymazegame.Xscaler,(scarymazegame.camera.viewportHeight)*scarymazegame.Yscaler);

		shape.setColor(Color.RED);
		shape.filledRect((scarymazegame.camera.viewportWidth/2)*scarymazegame.Xscaler,(scarymazegame.camera.viewportHeight/2)*scarymazegame.Yscaler, 50*scarymazegame.Xscaler, 50*scarymazegame.Yscaler);
		shape.setColor(Color.BLUE);

		shape.filledRect(((scarymazegame.camera.viewportWidth/2)-50)*scarymazegame.Xscaler,(scarymazegame.camera.viewportHeight/2)*scarymazegame.Yscaler, 50*scarymazegame.Xscaler, 50*scarymazegame.Yscaler);

		shape.end();

		
		batch.begin();
		//Draw FPS and Weapon Data
		font.setColor(Color.WHITE);
		font.draw(batch, "Dat Menu", 375*scarymazegame.Xscaler, 400*scarymazegame.Yscaler);
		font.draw(batch, "Play", 350*scarymazegame.Xscaler, 290*scarymazegame.Yscaler);
		font.draw(batch, "Exit", 400*scarymazegame.Xscaler, 290*scarymazegame.Yscaler);


		batch.end();
		
		if(Gdx.input.isTouched()) {
			if(Gdx.input.getY()/scarymazegame.Yscaler > 200 && Gdx.input.getY()/scarymazegame.Yscaler < 300) {
				if(Gdx.input.getX()/scarymazegame.Xscaler > 350 && Gdx.input.getX()/scarymazegame.Xscaler < 400) {
					System.out.println("Game");
					scarymazegame.mode = "Game";
				}

				if(Gdx.input.getX()/scarymazegame.Xscaler > 400 && Gdx.input.getX()/scarymazegame.Xscaler < 450) {
					System.out.println("Kill");
					Gdx.app.exit();
				}
			}
			System.out.println(Gdx.input.getX()/scarymazegame.Xscaler + ", " + Gdx.input.getY()/scarymazegame.Yscaler);
		}
	}
	@Override
	public void resize(int width, int height) {

	}
	@Override
	public void show() {
		batch = new SpriteBatch();
		font = new BitmapFont();
		shape = new ShapeRenderer();

	}
	@Override
	public void hide() {

	}
	@Override
	public void pause() {

	}
	@Override
	public void resume() {

	}
	@Override
	public void dispose() {	

	}
	@Override
	public void create() {
		// TODO Auto-generated method stub

	}
}
